package com.mall.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.bean.SystemLogs;
import com.mall.mapper.SystemLogsMapper;
import com.mall.service.SystemLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @PageName com.mall.serviceImpl
 * @Description 操作日志实现类
 * @Author 何全裕
 * @Create 2017-09-11 21:26
 * @Version 1.0
 **/
@Service
public class SystemLogsServiceImpl implements SystemLogsService {
    @Autowired
    private SystemLogsMapper systemLogsMapper;


    public void insertLogs(SystemLogs log) {
        systemLogsMapper.insertLogs(log);
    }

    public PageInfo getLogsListByPage(SystemLogs log,int page,int limit) {
        PageHelper.startPage(page,limit);
        List<SystemLogs> logsListByPage = systemLogsMapper.getLogsListByPage(log);
        PageInfo<SystemLogs> pageInfo = new PageInfo<SystemLogs>(logsListByPage);
        return pageInfo;
    }
}
